package ar.com.freesales.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import ar.com.freesales.enums.ActionEnum;
import ar.com.freesales.enums.RoomTypeEnum;
import ar.com.freesales.enums.StatusEnum;

@SuppressWarnings("serial")
@Entity
@Table(name = "CHANGE_LOG")
public class ChangeLog implements Serializable{
	
	private Long id;
	private UserDetail userDetail;
	private Ota ota;
	private ActionEnum actionEnum;
	private RoomTypeEnum roomTypeEnum;
	private StatusEnum statusEnum;
	private Date date;
	private Double value;
	
	private Long idDateBatch;
	
	private String errorDetail;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "ID")
	public Long getId() {
		return id;
	}
	
	@ManyToOne
    @JoinColumn(name = "ID_USER_DETAIL")
	public UserDetail getUserDetail() {
		return userDetail;
	}
	
	@ManyToOne
    @JoinColumn(name = "ID_OTA")
	public Ota getOta() {
		return ota;
	}
	
	@Column (name = "ID_DATE_BATCH")
	public Long getIdDateBatch() {
		return idDateBatch;
	}
	
	@Column (name = "ID_ACTION")
	@Enumerated(EnumType.ORDINAL)
	public ActionEnum getActionEnum() {
		return actionEnum;
	}
	
	@Column(name = "ID_ROOM_TYPE")
	@Enumerated(EnumType.ORDINAL)
	public RoomTypeEnum getRoomTypeEnum() {
		return roomTypeEnum;
	}
	
	@Column(name = "ID_STATUS")
	@Enumerated(EnumType.ORDINAL)
	public StatusEnum getStatusEnum() {
		return statusEnum;
	}
	
	@Column(name = "VALUE")
	public Double getValue() {
		return value;
	}
	
	@Column(name = "DATE")
	public Date getDate() {
		return date;
	}
	
	@Column(name = "ERROR_DETAIL")
	public String getErrorDetail() {
		return errorDetail;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setUserDetail(UserDetail userDetail) {
		this.userDetail = userDetail;
	}

	public void setOta(Ota ota) {
		this.ota = ota;
	}

	public void setActionEnum(ActionEnum actionEnum) {
		this.actionEnum = actionEnum;
	}

	public void setRoomTypeEnum(RoomTypeEnum roomTypeEnum) {
		this.roomTypeEnum = roomTypeEnum;
	}

	public void setStatusEnum(StatusEnum statusEnum) {
		this.statusEnum = statusEnum;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public void setValue(Double value) {
		this.value = value;
	}

	public void setIdDateBatch(Long idDateBatch) {
		this.idDateBatch = idDateBatch;
	}

	public void setErrorDetail(String errorDetail) {
		this.errorDetail = errorDetail;
	}
	
	
	
}
